package Controllers;

import DB.DBCheckpoint;
import Models.Checkpoint;
import java.util.ArrayList;

public class CheckpointController implements ControllerInterface<Checkpoint>
{ 
	public CheckpointController ()
	{}

	public int insert(Checkpoint checkpoint)
	{
		DBCheckpoint dbc = new DBCheckpoint();
		return dbc.insert(checkpoint.exportData());
	}

	public void insertDependent(ArrayList<? extends DB.RowInterface> data)
	{}

	public Checkpoint find(int id)
	{
		DBCheckpoint dbc = new DBCheckpoint();
		return dbc.fetchByNo(id);
	}

	public int update(Checkpoint checkpoint, String where)
	{
		DBCheckpoint dbc = new DBCheckpoint();
		return dbc.update(checkpoint.exportData(), where);
	}

	public void updateDependent(ArrayList<? extends DB.RowInterface> data, String where)
	{}

	public int delete(int id)
	{
		DBCheckpoint dbc = new DBCheckpoint();
		return dbc.deleteByNo(id);
	}

	public ArrayList<Checkpoint> fetchAll()
	{
		DBCheckpoint dbc = new DBCheckpoint();
		return dbc.fetchAll();
	}
}